# eric7.WebBrowser.WebBrowserWebSearchWidget

Module implementing a web search widget for the web browser.

### Global Attributes

None

### Classes

WebBrowserWebSearchWidget | Class implementing a web search widget for the web browser.

### Functions

None

## WebBrowserWebSearchWidget

Class implementing a web search widget for the web browser.

### Signals

search(QUrl)
  emitted when the search should be done

### Derived from

EricClearableLineEdit

### Class Attributes

None

### Class Methods

None

### Methods

WebBrowserWebSearchWidget | Constructor
__completerActivated | Private slot handling the selection of an entry from the completer.
__completerHighlighted | Private slot handling the highlighting of an entry of the completer.
__currentEngineChanged | Private slot to track a change of the current search engine.
__engineImageChanged | Private slot to handle a change of the current search engine icon.
__getSuggestions | Private slot to get search suggestions from the configured search engine.
__handleEnginesMenuActionTriggered | Private slot to handle an action of the menu being triggered.
__loadSearches | Private method to load the recently performed web searches.
__newSuggestions | Private slot to receive a new list of suggestions.
__searchButtonClicked | Private slot to show the search menu via the search button.
__searchNow | Private slot to perform the web search.
__setupCompleterMenu | Private method to create the completer menu.
__showEnginesMenu | Private slot to handle the display of the engines menu.
__showEnginesMenuCallback | Private method handling the open search links callback.
__textEdited | Private slot to handle changes of the search text.
clear | Public method to clear all private data.
mousePressEvent | Protected method called by a mouse press event.
openSearchManager | Public method to get a reference to the opensearch manager object.
preferencesChanged | Public method to handle the change of preferences.
saveSearches | Public method to save the recently performed web searches.

### Static Methods

None

#### WebBrowserWebSearchWidget (Constructor)

WebBrowserWebSearchWidget(mainWindow, parent=None)

Constructor

mainWindow (WebBrowserWindow)
  reference to the browser main window
parent (QWidget)
  reference to the parent widget

#### WebBrowserWebSearchWidget.__completerActivated

__completerActivated(index)

Private slot handling the selection of an entry from the completer.

index (QModelIndex)
  index of the item

#### WebBrowserWebSearchWidget.__completerHighlighted

__completerHighlighted(index)

Private slot handling the highlighting of an entry of the completer.

index (QModelIndex)
  index of the item

Return:
  flah indicating a successful highlighting

Return Type:
  bool

#### WebBrowserWebSearchWidget.__currentEngineChanged

__currentEngineChanged()

Private slot to track a change of the current search engine.

#### WebBrowserWebSearchWidget.__engineImageChanged

__engineImageChanged()

Private slot to handle a change of the current search engine icon.

#### WebBrowserWebSearchWidget.__getSuggestions

__getSuggestions()

Private slot to get search suggestions from the configured search engine.

#### WebBrowserWebSearchWidget.__handleEnginesMenuActionTriggered

__handleEnginesMenuActionTriggered(action)

Private slot to handle an action of the menu being triggered.

action (QAction)
  reference to the action that triggered

#### WebBrowserWebSearchWidget.__loadSearches

__loadSearches()

Private method to load the recently performed web searches.

#### WebBrowserWebSearchWidget.__newSuggestions

__newSuggestions(suggestions)

Private slot to receive a new list of suggestions.

suggestions (list of str)
  list of suggestions

#### WebBrowserWebSearchWidget.__searchButtonClicked

__searchButtonClicked()

Private slot to show the search menu via the search button.

#### WebBrowserWebSearchWidget.__searchNow

__searchNow()

Private slot to perform the web search.

#### WebBrowserWebSearchWidget.__setupCompleterMenu

__setupCompleterMenu()

Private method to create the completer menu.

#### WebBrowserWebSearchWidget.__showEnginesMenu

__showEnginesMenu()

Private slot to handle the display of the engines menu.

#### WebBrowserWebSearchWidget.__showEnginesMenuCallback

__showEnginesMenuCallback(res)

Private method handling the open search links callback.

res (list of dict)
  result of the JavaScript

#### WebBrowserWebSearchWidget.__textEdited

__textEdited(txt)

Private slot to handle changes of the search text.

txt (str)
  search text

#### WebBrowserWebSearchWidget.clear

clear()

Public method to clear all private data.

#### WebBrowserWebSearchWidget.mousePressEvent

mousePressEvent(evt)

Protected method called by a mouse press event.

evt (QMouseEvent)
  reference to the mouse event

#### WebBrowserWebSearchWidget.openSearchManager

openSearchManager()

Public method to get a reference to the opensearch manager object.

Return:
  reference to the opensearch manager object

Return Type:
  OpenSearchManager

#### WebBrowserWebSearchWidget.preferencesChanged

preferencesChanged()

Public method to handle the change of preferences.

#### WebBrowserWebSearchWidget.saveSearches

saveSearches()

Public method to save the recently performed web searches.

Up